import type { IBaseResponse, IExcelResponse, IGetConfigParams, IResponseConfig, IResponseTable } from '@/types/api/index.js'
import request from '@/utils/request.js'

const API = {
  GET_CONFIG: '/APSAPI/GetConfig', // 获取表头 查询框数据接口
  GET_DATA_BY_ID: '/APSAPI/APSData', // 获取ID对应数据接口
  DATA_EXPORT: '/APSAPI/APSDataExcel', // 导出数据接口
  SAVE_DATA: '/APSAPI/SaveData', // 保存数据接口
}
// 获取表格-> 表头 搜索框 按钮 数据
export const getConfigAPI = (data: IGetConfigParams[]) => request.post<IResponseConfig>(API.GET_CONFIG, data)
// 获取表格 数据
export const getDataByIDAPI = (data: any) => request.post<IResponseTable>(API.GET_DATA_BY_ID, data)
// 导出数据
export const dataExportAPI = (data: any) => request.post<IExcelResponse>(API.DATA_EXPORT, data)
// 保存数据
export const saveDataAPI = (data: any) => request.post<IBaseResponse>(API.SAVE_DATA, data)
